/**
 * 
 */
package com.visikard.item;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * @author Nghi Do
 */
public class AccountObject {
	private String  dateCreated = null;
	private String lastModified = null;
	private String username = null;
	private String password = null;
	private String fname = null;
	private String lname = null;
	private String email = null;
	
	private int enabled = -1;
	private long fkUserType = -1;
	private long fkUserLevel = -1;
	private long fkEnterprise = -1;
	private long fkCompany = -1;
	private long fkDivision = -1;
	private long fkDepartment = -1;
	private int isFriendDiscovery = -1;
	private int isAutoCheckin = -1;
	private int xchangeTimeout = -1;
	private int isEmailAlerts = -1;
	private int isEmailMessages = -1;
	private int isTextAlerts = -1;
	private int isTextMessages = -1;
	private long defaultKard = -1;
	private long idUsers = -1;
	private String sessionID = null;
	
	
	public AccountObject(){
		
	}
	
	public AccountObject(JSONObject jobject) throws JSONException{
		if(jobject == null) return;
		
		dateCreated = jobject.optString("dateCreated", "");//("dateCreated");
		lastModified = jobject.optString("lastModified","");
		username = jobject.optString("username","");
		password = jobject.optString("password","");
		fname = jobject.optString("fname","");
		if( fname.equals("null")) {
			fname = "";
		}		
		lname = jobject.optString("lname","");
		if( lname.equals("null")) {
			lname = "";
		}
		email = jobject.optString("email","");
		sessionID = jobject.optString("sessionID","");
		
		enabled = jobject.optInt("enabled", -1);
		fkUserType = jobject.optLong("fkUserType",-1);
		fkUserLevel = jobject.optLong("fkUserLevel",-1);
		fkEnterprise = jobject.optLong("fkEnterprise",-1);
		fkCompany = jobject.optLong("fkCompany",-1);
		fkDivision = jobject.optLong("fkDivision",-1);
		fkDepartment = jobject.optLong("fkDepartment",-1);
		isFriendDiscovery = jobject.optInt("isFriendDiscovery",-1);
		isAutoCheckin = jobject.optInt("isAutoCheckin",-1);
		xchangeTimeout = jobject.optInt("xchangeTimeout",-1);
		isEmailAlerts = jobject.optInt("isEmailAlerts",-1);
		isEmailMessages = jobject.optInt("isEmailMessages",-1);
		isTextAlerts = jobject.optInt("isTextAlerts",-1);
		isTextMessages = jobject.optInt("isTextMessages",-1);
		defaultKard = jobject.optLong("defaultKard",-1);
		idUsers = jobject.optLong("idUsers",-1);		
	}

	/**
	 * @return the dateCreated
	 */
	public String getDateCreated() {
		return dateCreated;
	}

	/**
	 * @param dateCreated the dateCreated to set
	 */
	public void setDateCreated(String dateCreated) {
		this.dateCreated = dateCreated;
	}

	/**
	 * @return the lastModified
	 */
	public String getLastModified() {
		return lastModified;
	}

	/**
	 * @param lastModified the lastModified to set
	 */
	public void setLastModified(String lastModified) {
		this.lastModified = lastModified;
	}

	/**
	 * @return the username
	 */
	public String getUsername() {
		return username;
	}

	/**
	 * @param username the username to set
	 */
	public void setUsername(String username) {
		this.username = username;
	}

	/**
	 * @return the password
	 */
	public String getPassword() {
		return password;
	}

	/**
	 * @param password the password to set
	 */
	public void setPassword(String password) {
		this.password = password;
	}

	/**
	 * @return the fname
	 */
	public String getFname() {
		return fname;
	}

	/**
	 * @param fname the fname to set
	 */
	public void setFname(String fname) {
		this.fname = fname;
	}

	/**
	 * @return the lname
	 */
	public String getLname() {
		return lname;
	}

	/**
	 * @param lname the lname to set
	 */
	public void setLname(String lname) {
		this.lname = lname;
	}

	/**
	 * @return the email
	 */
	public String getEmail() {
		return email;
	}

	/**
	 * @param email the email to set
	 */
	public void setEmail(String email) {
		this.email = email;
	}

	/**
	 * @return the enabled
	 */
	public int getEnabled() {
		return enabled;
	}

	/**
	 * @param enabled the enabled to set
	 */
	public void setEnabled(int enabled) {
		this.enabled = enabled;
	}

	/**
	 * @return the fkUserType
	 */
	public long getFkUserType() {
		return fkUserType;
	}

	/**
	 * @param fkUserType the fkUserType to set
	 */
	public void setFkUserType(long fkUserType) {
		this.fkUserType = fkUserType;
	}

	/**
	 * @return the fkUserLevel
	 */
	public long getFkUserLevel() {
		return fkUserLevel;
	}

	/**
	 * @param fkUserLevel the fkUserLevel to set
	 */
	public void setFkUserLevel(long fkUserLevel) {
		this.fkUserLevel = fkUserLevel;
	}

	/**
	 * @return the fkEnterprise
	 */
	public long getFkEnterprise() {
		return fkEnterprise;
	}

	/**
	 * @param fkEnterprise the fkEnterprise to set
	 */
	public void setFkEnterprise(long fkEnterprise) {
		this.fkEnterprise = fkEnterprise;
	}

	/**
	 * @return the fkCompany
	 */
	public long getFkCompany() {
		return fkCompany;
	}

	/**
	 * @param fkCompany the fkCompany to set
	 */
	public void setFkCompany(long fkCompany) {
		this.fkCompany = fkCompany;
	}

	/**
	 * @return the fkDivision
	 */
	public long getFkDivision() {
		return fkDivision;
	}

	/**
	 * @param fkDivision the fkDivision to set
	 */
	public void setFkDivision(long fkDivision) {
		this.fkDivision = fkDivision;
	}

	/**
	 * @return the fkDepartment
	 */
	public long getFkDepartment() {
		return fkDepartment;
	}

	/**
	 * @param fkDepartment the fkDepartment to set
	 */
	public void setFkDepartment(long fkDepartment) {
		this.fkDepartment = fkDepartment;
	}

	/**
	 * @return the isFriendDiscovery
	 */
	public int getIsFriendDiscovery() {
		return isFriendDiscovery;
	}

	/**
	 * @param isFriendDiscovery the isFriendDiscovery to set
	 */
	public void setIsFriendDiscovery(int isFriendDiscovery) {
		this.isFriendDiscovery = isFriendDiscovery;
	}

	/**
	 * @return the isAutoCheckin
	 */
	public int getIsAutoCheckin() {
		return isAutoCheckin;
	}

	/**
	 * @param isAutoCheckin the isAutoCheckin to set
	 */
	public void setIsAutoCheckin(int isAutoCheckin) {
		this.isAutoCheckin = isAutoCheckin;
	}

	/**
	 * @return the xchangeTimeout
	 */
	public int getXchangeTimeout() {
		return xchangeTimeout;
	}

	/**
	 * @param xchangeTimeout the xchangeTimeout to set
	 */
	public void setXchangeTimeout(int xchangeTimeout) {
		this.xchangeTimeout = xchangeTimeout;
	}

	/**
	 * @return the isEmailAlerts
	 */
	public int getIsEmailAlerts() {
		return isEmailAlerts;
	}

	/**
	 * @param isEmailAlerts the isEmailAlerts to set
	 */
	public void setIsEmailAlerts(int isEmailAlerts) {
		this.isEmailAlerts = isEmailAlerts;
	}

	/**
	 * @return the isEmailMessages
	 */
	public int getIsEmailMessages() {
		return isEmailMessages;
	}

	/**
	 * @param isEmailMessages the isEmailMessages to set
	 */
	public void setIsEmailMessages(int isEmailMessages) {
		this.isEmailMessages = isEmailMessages;
	}

	/**
	 * @return the isTextAlerts
	 */
	public int getIsTextAlerts() {
		return isTextAlerts;
	}

	/**
	 * @param isTextAlerts the isTextAlerts to set
	 */
	public void setIsTextAlerts(int isTextAlerts) {
		this.isTextAlerts = isTextAlerts;
	}

	/**
	 * @return the isTextMessages
	 */
	public int getIsTextMessages() {
		return isTextMessages;
	}

	/**
	 * @param isTextMessages the isTextMessages to set
	 */
	public void setIsTextMessages(int isTextMessages) {
		this.isTextMessages = isTextMessages;
	}

	/**
	 * @return the defaultKard
	 */
	public long getDefaultKard() {
		return defaultKard;
	}

	/**
	 * @param defaultKard the defaultKard to set
	 */
	public void setDefaultKard(long defaultKard) {
		this.defaultKard = defaultKard;
	}

	/**
	 * @return the idUsers
	 */
	public long getIdUsers() {
		return idUsers;
	}

	/**
	 * @param idUsers the idUsers to set
	 */
	public void setIdUsers(long idUsers) {
		this.idUsers = idUsers;
	}

	public String getSessionID() {
		return sessionID;
	}

	public void setSessionID(String sessionID) {
		this.sessionID = sessionID;
	}
	
}
